package com.zb.vo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.zb.entity.ZjGoodsParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * @Author WEN
 * @Date 2023/8/3 0003
 **/
@Data
@ApiModel("商品参数列表对象")
public class GoodsParamListVo {
    @ApiModelProperty(value = "主健ID")
    private Long id;

    @ApiModelProperty(value = "参数名称")
    private String name;

    @ApiModelProperty(value = "参数状态：false-启用，true-禁用")
    private Boolean status;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    public static GoodsParamListVo beanToVo(ZjGoodsParam param) {
        GoodsParamListVo vo = new GoodsParamListVo();
        BeanUtils.copyProperties(param, vo);
        vo.setStatus(param.getDisabled());
        vo.setCreateTime(param.getGmtCreate());
        vo.setUpdateTime(param.getGmtUpdate());
        return vo;
    }
}
